package com.itheima.zy;
/*
    4.有如下字符串:"12ab","java","cd","Server78"
    遍历这些字符串，如果字符串没有包含数字的，就将字符串中的小写字母转成大写字母并打印字符串
     */
public class di5 {
    public static void main(String[] args) {
        String[] strs = {"12ab", "java", "cd", "Server78"};
        //遍历这些字符串
        for (int i = 0; i < strs.length; i++) {
            String str = strs[i];
            if(!checkNumber(str)){
                System.out.println(str.toUpperCase());
            }
        }
    }

    public static boolean checkNumber(String str) {
        //String->char[]
        char[] chars = str.toCharArray();
        //遍历字符数组
        for (int j = 0; j < chars.length; j++) {
            //判断是否带数字
            char c = chars[j];
            if (c >= '0' && c <= '9') {
                return true;
            }
        }
        return false;
    }
}
